#ifndef ENTITY_H
#define ENTITY_H

#include <map>
#include <set>
#include <vector>

#include "ConfigComponent.h"

namespace Y{

class FunctorContainer;
class AnimationBase;

typedef std::vector< ConfigComponent > ConfigVector;

class Entity{
	
	public:
		Entity * parent_entity;
		std::vector<Entity*> children;
		//Signal map  |||  Functor Links
		std::map	< OString,FunctorContainer* >	signalMap;
		std::vector	< FunctorContainer* > functorLinks;
		
		int ID;
		//Animation Data
		std::map < OString, AnimationBase * > animations;
		
	public:
		Entity();
		Entity(Entity * parentis);
		virtual ~Entity();
		virtual void die ();
		
		#include "EntityConfigureFunctions.h"
		
		virtual void handleConfig ( ConfigVector& cv );
			void configSubsystem ( ConfigVector& cv );
			
		virtual void timer (float);
			void timerSubsystem (float);
			
		virtual void addChild (Entity *e);
		virtual void removeChild (Entity *e);
			
		virtual void addAnimation (const OString& nomen, AnimationBase *ptr);
		virtual void removeAnimation (OString nomen, bool destroy = true); 
		virtual AnimationBase* animation (const OString& nomen);
			
		#include "EntityConvenienceSlots.h"
			
		#include "EntityFunctionLinker.h"
		void addSignal ( const char *c );
		void removeFunctorLink ( FunctorContainer * );
		
		Entity * parent (){ return parent_entity; }
};

#include "Functor.h"
#include "EntityFunctionLinkerImp.h"

}

#endif
